package com.example.demo.Mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.pojo.Blog;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
public interface BlogMapper extends BaseMapper<Blog> {
    @Select("SELECT * FROM blog ORDER BY blog.`id` DESC LIMIT 0,10")
    List<Blog> getBloglistTop10();
    @Select("select * from blog where blog.'title' like '%#{title}% ORDER by blog.'id' DESC'")
    List<Blog> getSearch(@Param("title") String title);
}
